function runallmnist(C)
tic
disp('Loading data...');
load 7nneigsplus;
clear Dvec;
clear IDXvec;
clear D;
load mnist_train;
load mnist_test;
n = size(V,1);
X = [xL,xU;ones(1,n)];
clear xL;
clear xU;

k = 7;
s = 100;

c = 10;


Y = yL';
l = size(yL,2);
Y = [(Y==0) (Y==1) (Y==2) (Y==3) (Y==4) (Y==5) (Y==6) (Y==7) (Y==8) (Y==9)];
Y = Y - (Y==0);
Y = double(Y);
disp('Data loaded!');

V = V(:,1:s);

T = X*V;
TT = T'*inv(X*X')*T;
clear X;
clear T;

P = zeros(l,s,c);
for i = 1:c
    P(:,:,i) = repmat(Y(:,i),1,s).*V(1:l,:);
end
Q = V(l+1:n,:);
clear V;

disp('Start optimization...');
tic
cvx_begin sdp
cvx_solver sedumi
    variable t
    variable gam(s,c)
    variable M(s,s) symmetric
    variable del(l,1) nonnegative
    variable bb(c,1)
    minimize (t+2*C*sum(del));
    for i=1:c
        [M,gam(:,i);gam(:,i)',t] >= 0;
        P(:,:,i)*gam(:,i)+bb(i)*Y(:,i)-ones(l,1)+del >= 0;
    end
    trace(M)-trace(M*TT) == n;
cvx_end
sltime = toc

[~,Ypred] = max(Q*gam+repmat(bb',n-l,1),[],2);
Ypred = int8(Ypred)-1;

label = int8(yU');
acc = calacc(Ypred,label);
numsv = sum(del>0);
save(['res/MTTAL',int2str(l),'K',int2str(k),'S',int2str(s),'C',C],'acc','numsv','M','gam','bb','sltime');
end
